<template>
    <div class="app-container">
        <el-row>
            <el-col :span="24" :inline="true" class="operateView">
                <el-form :inline="true" style="margin:10px 0;">
                    <el-button @click="operateAction('back')" type="info" plain size="small">返回</el-button>
                </el-form>
            </el-col>
        </el-row>
        <el-descriptions title="" :column="1" direction="vertical" border size='medium'>
            <el-descriptions-item label="基本信息">
                <el-form :inline="true">
                    <el-form-item label="会员ID："  style="width:30%"> {{ userModel.code }} </el-form-item>
                    <el-form-item label="会员手机号："  style="width:30%"> {{ userModel.phone}} </el-form-item>
                    <el-form-item label="会员性别："  style="width:30%"> {{ userModel.gender=='W'?'女':'男'}} </el-form-item>
                    <el-form-item label="推荐上级："  style="width:30%"> {{ userModel.parentModel?userModel.parentModel.code:'未知'}} </el-form-item>
                    <el-form-item label="会员身份："  style="width:30%"> {{ userModel.rankModel?userModel.rankModel.name:'未知'}} </el-form-item>
                    <el-form-item label="会员昵称："  style="width:30%"> {{ userModel.nickname }} </el-form-item>
                    <el-form-item label="账户余额："  style="width:30%"> {{ userModel.incomes }} </el-form-item>
                    <el-form-item label="账户积分："  style="width:30%"> {{ userModel.incomes }} </el-form-item>
                    <el-form-item label="累计提现余额："  style="width:30%"> {{ userModel.historyIncomes }} </el-form-item>
                    <el-form-item label="真是姓名："  style="width:30%"> {{ userModel.realname }} </el-form-item>
                    <el-form-item label="所在城市："  style="width:30%"> {{ userModel.city }} </el-form-item>
                    <el-form-item label="是否为机器人："  style="width:30%"> {{ userModel.isRobot==true?'是机器人':'否' }} </el-form-item>
                    <el-form-item label="注册时间："  style="width:30%">
                    {{ formatTime.dateFormat('YY-MM-DD hh:mm:ss', userModel.createTime) }}
                    </el-form-item>
                    <el-form-item label="最近登陆时间："  style="width:30%">
                    {{ formatTime.dateFormat('YY-MM-DD hh:mm:ss', userModel.lastVisitTime) }}
                    </el-form-item>
                    <el-form-item label="VIP会员升级时间：" style="width:30%">
                    {{ userModel.upRankTime ? formatTime.dateFormat('YY-MM-DD hh:mm:ss', userModel.upRankTime) :'未记录' }}
                    </el-form-item>
                </el-form>
            </el-descriptions-item>
        </el-descriptions>
      
    </div>
  </template>
  
  <script>
  import { getUserInfoById } from "@/api/system/user.js";
  
  export default {
    components: {
      
    },
    props: {

    },
    data() {
      return {

        rowId: '',
        userModel: {},
        currentRouteName:''
      }
    },
    created(){
        if (this.$route.query.currentRouteName) {
            this.currentRouteName = this.$route.query.currentRouteName
        }
        this.rowId = this.$route.query.rowId || ''
        this.getUserInfoById()
    },
    methods:{
        getUserInfoById(){
            getUserInfoById({
                obj_id: this.rowId
            }).then(res=>{
                if (res.data.code == 10000) {
                    this.userModel = res.data.data
                }
            })
        },
        operateAction(scene) {
            var data = {}
            switch (scene) {
                case 'back':
                    this.$router.push({name: this.currentRouteName, params: {}})
                    break;
                default:
                    break;
            }
        },
    }
  }
  </script>
  
  <style lang="scss" scoped>
  </style>
